* If 'estout' is not installed, please uncomment the next line
*ssc install estout

* This STATA file assumes the presence of 'gstyping.dta' and '1_measures.do' from the replication files of the paper by Alan, S., Ertac, S. and Mumcu, I. (2018) "Replication Data for: Gender Stereotypes in the Classroom and Effects on Achievement", https://doi.org/10.7910/DVN/FGBZCK, Harvard Dataverse
clear all
use "gstyping.dta"
run 1_measures.do

* Determine the estimates and t-ratios for regression (1) of the paper, shown in the first two rows of Table 3
*GIRLS
*Gender Role Beliefs
xi: reg zstud_gender hightbias tmale tss_behavior age_m_mean conf zgms_stud raven_std  i.ses working_mom computer hhgender i.ts_4 ts_2 i.proximity i.qual ts_3 tt_train ts_5 gms extrinsic constructive warmth  if male==0, cluster(teachername)
estimates store spec1
xi: reg zstud_gender hightbias tmale tss_behavior age_m_mean conf zgms_stud raven_std  i.ses working_mom computer hhgender i.ts_4 ts_2 i.proximity i.qual ts_3 tt_train ts_5 gms extrinsic constructive warmth  if male==0 & term_t==1, cluster(teachername)
estimates store spec2
xi: reg zstud_gender hightbias tmale tss_behavior age_m_mean conf zgms_stud raven_std  i.ses working_mom computer hhgender i.ts_4 ts_2 i.proximity i.qual ts_3 tt_train ts_5 gms extrinsic constructive warmth  if male==0 & term_t==2, cluster(teachername)
estimates store spec3
xi: reg zstud_gender hightbias tmale tss_behavior age_m_mean conf zgms_stud raven_std  i.ses working_mom computer hhgender i.ts_4 ts_2 i.proximity i.qual ts_3 tt_train ts_5 gms extrinsic constructive warmth  if male==0 & term_t==3, cluster(teachername)
estimates store spec4
esttab spec1 spec2 spec3 spec4 using "Table3_Girls_Reg1.csv", replace label title("Gender-Role: Girls") mtitles("Full" "1-Year" "2-3 Year" "4-Year") compress  b(%8.3f) t(%8.3f) nonumbers wide nonotes plain keep(hightbias)
est clear

* Determine the estimates and t-ratios for regression (2) of the paper, shown in the third and fourth rows of Table 3
*GIRLS
*Gender Role Beliefs: Exposure 1-4 Years
xi: regress turkish_std zstud_gender hightbias lterm termbiasl age_m_mean tss_behavior conf         zgms_stud raven_std lowses medses working_mom computer hhgender educ1 educ2 ts_2 qual1-qual4 ts_3 tt_train ts_5 gms extrinsic constructive warmth prox2-prox30 if male==0, cluster(teachername)
estimates store spec1
*Gender Role Beliefs: Exposure 1 Year
xi: regress turkish_std zstud_gender hightbias lterm termbiasl age_m_mean tss_behavior conf         zgms_stud raven_std lowses medses working_mom computer hhgender educ1 educ2 ts_2 qual1-qual4 ts_3 tt_train ts_5 gms extrinsic constructive warmth prox2-prox30 if male==0 & term_t==1, cluster(teachername)
estimates store spec2
*Gender Role Beliefs: Exposure 2-3 Years
xi: regress turkish_std zstud_gender hightbias lterm termbiasl age_m_mean tss_behavior conf         zgms_stud raven_std lowses medses working_mom computer hhgender educ1 educ2 ts_2 qual1-qual4 ts_3 tt_train ts_5 gms extrinsic constructive warmth prox2-prox30 if male==0 & term_t==2, cluster(teachername)
estimates store spec3
*Gender Role Beliefs: Exposure 4 Years
xi: regress turkish_std zstud_gender hightbias lterm termbiasl age_m_mean tss_behavior conf         zgms_stud raven_std lowses medses working_mom computer hhgender educ1 educ2 ts_2 qual1-qual4 ts_3 tt_train ts_5 gms extrinsic constructive warmth prox2-prox30 if male==0 & term_t==3, cluster(teachername)
estimates store spec4
esttab spec1 spec2 spec3 spec4 using "Table3_Girls_Reg2.csv", replace label title("Gender-Role: Girls") mtitles("Full" "1-Year" "2-3 Year" "4-Year") compress  b(%8.3f) t(%8.3f) nonumbers wide nonotes plain keep(zstud_gender)
est clear
